# -*- coding:utf-8 *-
# 项目       :    易聊测试 
# 文件       :    auto-duihua.py
# 作者       :    zc 
# 时间       :    2021/9/13  11:29 上午 
# IDE       :    PyCharm
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
import time
import os

def openURL():
    d = webdriver.Chrome()
    d.wait = WebDriverWait(d,10)
    d.set_window_size(1620, 960)
    d.get("file:///Users/a1234/Downloads/dev%E7%8E%AF%E5%A2%83%E8%90%BD%E5%9C%B0%E9%A1%B5.html")
    time.sleep(5)
    # d.find_element_by_id('jesong_message').click()
    data=1
    while data<3600:
        d.find_element_by_id('jesong_message').send_keys('我的第 %s 秒输入'%data)
        d.find_element_by_xpath('//*[@id="jesong_chat_send_btn"]/span').click()
        time.sleep(2)
        data +=1
        print(data)


if __name__ == '__main__':
    openURL()
